package com.xyc.manager.permission.mapper;


import com.xyc.manager.permission.bean.ChildTreeBean;
import com.xyc.manager.permission.bean.ParentTreeBean;
import com.xyc.manager.permission.bean.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PermissionMapper {

    public List<ParentTreeBean> queryParentTreeBeans(@Param("account") String account);
    //查询所有权限
    public List<ParentTreeBean> queryAllPermission();
    //查询所具有权限
    public List<ParentTreeBean> queryRolePermissionByRoleCode(@Param("roleCode") String roleCode);
    //删除权限
    public void canclePermission(@Param("fid") Integer fid);
    //删除子权限
    public void cancleChildPermissionByParent(@Param("moduleId") String moduleId, @Param("roleId") String roleId);

    public List<String> queryChildPermissionCode(@Param("fid") Integer fid);

    public void addPermission(@Param("roleId") String roleId, @Param("moduleId") String moduleId);
    //通过子类权限查父类
    public String queryParentPermissionCode(@Param("moduleCode") String moduleCode);

    //通过父权限代码查子权限代码
    public List<String> queryChildPermissionCodeList(@Param("moduleCode") String moduleCode);
    //单独查询三级目录
    public List<ChildTreeBean> queryGrandChildPermission();
    //根据moduleCode和roleId查询fid
    public Integer queryFidByModuleCodeAndRoleId(@Param("roleId") String roleId, @Param("moduleCode") String moduleCode);
    //根据moduleCode和roleId查询fid集合
    public List<Integer> queryFidListByModuleCodeAndRoleId(@Param("roleId") String roleId, @Param("moduleCode") String moduleCode);

    public List<SysRole> queryRoleList();
}
